<template>
  <div>
    <BaseTable :loading="store.loading" :data-source="store.tableData" fill column-code="000896">
      <template #bodyCell="{ column, record }">
        <template v-if="column.dataIndex === 'auditStatus'">
          <a-tag v-if="record.auditStatus === 0" color="blue">未审核</a-tag>
          <a-tag v-if="record.auditStatus === 1" color="green">已审核</a-tag>
        </template>
        <template v-if="column.dataIndex === 'operationStTime'">
          <EditCell title="手术开始时间">
            <a-date-picker
              v-model:value="record.operationStTime"
              class="w-full"
              format="YYYY-MM-DD HH:mm:ss"
              value-format="YYYY-MM-DD HH:mm:ss"
              placeholder="请选择"
              :disabled="record.auditStatus === 1"
            />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'operationEdTime'">
          <EditCell title="手术反室时间">
            <a-date-picker
              v-model:value="record.operationEdTime"
              class="w-full"
              format="YYYY-MM-DD HH:mm:ss"
              value-format="YYYY-MM-DD HH:mm:ss"
              placeholder="请选择"
              :disabled="record.auditStatus === 1"
            />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'checkTypeCode'">
          <EditCell title="测温方式">
            <SelectItem
              :value="record.checkTypeCode"
              type="CWFS00001"
              style-class="w-full"
              :disabled="record.auditStatus === 1"
              placeholder="请选择"
              @change="
                (_, $event) => {
                  record.checkTypeCode = $event?.value || ''
                }
              "
            />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'tpr'">
          <EditCell title="体温">
            <a-input v-model:value="record.tpr" v-input:float.3 class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'review'">
          <a-switch v-model:checked="record.review" :disabled="record.auditStatus === 1" />
        </template>
        <template v-if="column.dataIndex === 'pul'">
          <EditCell title="脉搏">
            <a-input v-model:value="record.pul" v-input:int class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'htr'">
          <EditCell title="心率">
            <a-input v-model:value="record.htr" v-input:int class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'brt'">
          <EditCell title="呼吸">
            <a-input v-model:value="record.brt" v-input:int class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" />
          </EditCell>
        </template>

        <template v-if="column.dataIndex === 'ltprTypeCode'">
          <EditCell title="降温方式">
            <SelectItem
              :value="record.ltprTypeCode"
              type="JWFS00001"
              style-class="w-full"
              :disabled="record.auditStatus === 1"
              placeholder="请选择"
              @change="
                (_, $event) => {
                  record.ltprTypeCode = $event?.value || ''
                }
              "
            />
          </EditCell>
        </template>

        <template v-if="column.dataIndex === 'ltpr'">
          <EditCell title="降温后体温">
            <a-input v-model:value="record.ltpr" v-input:float class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" />
          </EditCell>
        </template>
        <template v-if="column.dataIndex === 'painLevel'">
          <EditCell title="疼痛程度">
            <SelectItem
              :value="record.painLevel"
              class="w-full !min-w-0"
              type="DT00315"
              trigger="init"
              placeholder="请选择"
              @change="
                (_, $event) => {
                  record.painLevel = $event?.value || ''
                }
              "
            />
            <!-- <a-input v-model:value="record.painLevel" v-input:float class="w-full" :disabled="record.auditStatus === 1" placeholder="请输入" /> -->
          </EditCell>
        </template>
      </template>
    </BaseTable>
  </div>
</template>

<script setup>
import BaseTable from '@/components/BaseTable'
import useStore from '../store.js'

const store = useStore()
</script>
